
let Window = (function () {
    let window; //外部变量
    let window = function (name) { //内部变量
        if (!window) { 
            return window 
        }else{
            this.name = name;
            return(window =this)
        };
    }
    return Window;
})()


let w1 = new Window();
let w2 = new window();

/**
 * 
 * 违反了单一职责原则，
 * 
 */